<%
def sesUser = session?.user
%>
<html>
<head>
	<title>WatchYourExpenses</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
	
	<link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
	<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
	
	<link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.min.css" /> 
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/i8n/jquery.mobile.datebox.i8n.en.js"></script>
	
	<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
	<style type="text/css">
	.portrait label.error, .landscape label.error {
	    color: red;
	    font-size: 16px;
	    font-weight: normal;
	    line-height: 1.4;
	    margin-top: 0.5em;
	    width: 100%;
	    float: none;
	}
	.landscape label.error { 
		color: red;
	    display: inline-block; 
	    margin-left: 22%; 
	}
	.portrait label.error {
		color: red; 
	    margin-left: 0; 
	    display: block; 
	}
	
	label { width: 10em; float: left; }
	label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }

	em { 
	    color: red; 
	    font-weight: bold; 
	    padding-right: .25em; 
	}
	</style>
	
	<% if(!localMode) { %>	
	<script type="text/javascript">
  	var _gaq = _gaq || [];
  	_gaq.push(['_setAccount', 'UA-27276914-1']);
  	_gaq.push(['_setDomainName', 'watchyourexpenses.appspot.com']);
  	_gaq.push(['_trackPageview']);

  	(function() {
    	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  	})();
	</script>
	<% } %>
</head>

<div data-role="page">
	<div data-role="header">
		<h1>WYE - ${request.title}</h1>
	</div>
	<div data-role="content">
	<% if(params.errorMessage != null) { %>
		<p align="center">$params.errorMessage</p>
	<% } %>
	<% if(params.infoMessage != null) { %>
		<p align="center">$params.infoMessage</p>
	<% } %>
	<% include request.view %>
	</div>
	<div data-role="footer">
		<div class="ui-grid-a">
			<div class="ui-block-b" align="center">
			<a href="wydAbout.groovy">About</a>
			</div>
			<div class="ui-block-b" align="center">
				<% if(sesUser != null) { %>
				<a href="wydLogout.groovy" data-theme="b">Logout</a>
				<% } else { %>
				<a href="wydLogin.groovy" data-theme="b">Login</a>
				<% } %>
			</div>
		</div>
	</div>
</div>
<script>
\$(document).ready(function() {
	\$.mobile.ajaxLinksEnabled = false;
});
</script>
</body>
</html>